/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Controllers;

import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpSession;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.RequestDispatcher;
import java.util.*;
import java.text.*;
import Models.DauBep_Model;
import Models.KhuVuc_Model;
import Models.DoanhNghiep_Model;
/**
 *
 * @author Venus
 */
public class DauBep_Controller extends HttpServlet {
   
    /** 
     * Processes requests for both HTTP <code>GET</code> and <code>POST</code> methods.
     * @param request servlet request
     * @param response servlet response
     * @throws ServletException if a servlet-specific error occurs
     * @throws IOException if an I/O error occurs
     */
    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
        response.setContentType("text/html;charset=UTF-8");
        request.setCharacterEncoding("UTF-8");
        PrintWriter out = response.getWriter();
        HttpSession session = request.getSession();
        try {
            if (session.getAttribute("langid") == null) {
                response.sendRedirect("index.jsp");
                return;
            }
            session.removeAttribute("DSMA");
            session.removeAttribute("DSNMA");
            session.removeAttribute("item");
            int langid = (Integer) session.getAttribute("langid");
            String action = request.getParameter("action");
            if (action.equals("Show")) {
                DauBep_Model m = new DauBep_Model();
                Vector vDSMA = new Vector();                
                vDSMA = m.LayDSMACook(langid);
                Vector vTTMA = new Vector();
                vTTMA = m.LayTTMA(langid);
                KhuVuc_Model kv = new KhuVuc_Model();
                Vector vkv = new Vector();
                vkv = kv.LayDSKV(langid);
                int count = DauBep_Model.HoiThuc();
                if(count > 0){
                    Vector vDSHoiThuc = new Vector();
                    vDSHoiThuc = m.LayDSHoiThuc(langid);
                    request.setAttribute("DSHoiThuc", vDSHoiThuc);
                }
                request.setAttribute("DSMA", vDSMA);
                request.setAttribute("DSKV", vkv);
                request.setAttribute("DSTTMA", vTTMA);
                request.setAttribute("count", Integer.toString(count));
                RequestDispatcher rd = request.getRequestDispatcher("cook/rscook.jsp");
                rd.forward(request, response);
            }
            else if (action.equals("CookInteval")) {
                String ng = request.getParameter("ng");
                String kv = request.getParameter("kv");
                String b = request.getParameter("b");
                String ma = request.getParameter("ma");
                String dvt = request.getParameter("dvt");
                String sl = request.getParameter("sl");
                String ud1 = request.getParameter("ud1");
                String ud2 = request.getParameter("ud2");
                String ud3 = request.getParameter("ud3");
                String ud4 = request.getParameter("ud4");
                String ud5 = request.getParameter("ud5");
                String ud6 = request.getParameter("ud6");
                String makv = request.getParameter("makv");
                String tenban = request.getParameter("tenban");
                String tenma = request.getParameter("tenma");
                String tendvt = request.getParameter("tendvt");
                String soluong = request.getParameter("soluong");
                String mattma = request.getParameter("mattma");
                DauBep_Model m = new DauBep_Model();
                Vector vDSMA = new Vector();                
                vDSMA = m.CookInteval(makv, tenban, tenma, tendvt, soluong, mattma, ng, kv, b, ma, dvt, sl, ud1, ud2, ud3, ud4, ud5, ud6, langid);
                Vector vTTMA = new Vector();
                vTTMA = m.LayTTMA(langid);
                KhuVuc_Model khuvuc = new KhuVuc_Model();
                Vector vkv = new Vector();
                vkv = khuvuc.LayDSKV(langid);
                int count = DauBep_Model.HoiThuc();
                if(count > 0){
                    Vector vDSHoiThuc = new Vector();
                    vDSHoiThuc = m.LayDSHoiThuc(langid);
                    request.setAttribute("DSHoiThuc", vDSHoiThuc);
                }
                request.setAttribute("DSMA", vDSMA);
                request.setAttribute("DSKV", vkv);
                request.setAttribute("DSTTMA", vTTMA);
                request.setAttribute("ng", ng);
                request.setAttribute("kv", kv);
                request.setAttribute("b", b);
                request.setAttribute("ma", ma);
                request.setAttribute("dvt", dvt);
                request.setAttribute("sl", sl);
                request.setAttribute("ud1", ud1);
                request.setAttribute("ud2", ud2);
                request.setAttribute("ud3", ud3);
                request.setAttribute("ud4", ud4);
                request.setAttribute("ud5", ud5);
                request.setAttribute("ud6", ud6);
                request.setAttribute("makv", makv);
                request.setAttribute("tenban", tenban);
                request.setAttribute("tenma", tenma);
                request.setAttribute("tendvt", tendvt);
                request.setAttribute("soluong", soluong);
                request.setAttribute("mattma", mattma);
                request.setAttribute("count", Integer.toString(count));
                RequestDispatcher rd = request.getRequestDispatcher("cook/cookinteval.jsp");
                rd.forward(request, response);
            }
            else if(action.equals("DSHoiThuc")){
                DauBep_Model m = new DauBep_Model();
                int count = DauBep_Model.HoiThuc();
                if(count > 0){
                    Vector vDSHoiThuc = new Vector();
                    vDSHoiThuc = m.LayDSHoiThuc(langid);
                    request.setAttribute("DSHoiThuc", vDSHoiThuc);                    
                    RequestDispatcher rd = request.getRequestDispatcher("cook/dshoithuc.jsp");
                    rd.forward(request, response);
                }
            }
            else if(action.equals("CountDSHoiThuc")){
                DauBep_Model m = new DauBep_Model();
                int count = DauBep_Model.HoiThuc();
                if(count > 0){
                    out.print(count);
                }
            }
            else if (action.equals("Show3")) {
                DauBep_Model m = new DauBep_Model();
                Vector vDSMA = new Vector();
                vDSMA = m.LayDSMACook3(langid);
                Vector vTTMA = new Vector();
                vTTMA = m.LayTTMA(langid);
                KhuVuc_Model kv = new KhuVuc_Model();
                Vector vkv = new Vector();
                vkv = kv.LayDSKV(langid);
                int count = DauBep_Model.HoiThuc();
                if(count > 0){
                    Vector vDSHoiThuc = new Vector();
                    vDSHoiThuc = m.LayDSHoiThuc(langid);
                    request.setAttribute("DSHoiThuc", vDSHoiThuc);
                }
                request.setAttribute("DSMA", vDSMA);
                request.setAttribute("DSKV", vkv);
                request.setAttribute("DSTTMA", vTTMA);
                request.setAttribute("count", Integer.toString(count));
                RequestDispatcher rd = request.getRequestDispatcher("cook/rscook3.jsp");
                rd.forward(request, response);
            }
            else if(action.equals("UpdateTTMACook")){
                String MaCTHDT = request.getParameter("MaCTHDT");
                String MaTTMA = request.getParameter("MaTTMA");
                DauBep_Model.UpdateTTMACook(Integer.parseInt(MaCTHDT), Integer.parseInt(MaTTMA));
                DauBep_Model m = new DauBep_Model();
                Vector vDSMA = new Vector();
                vDSMA = m.LayDSMACook(langid);
                Vector vTTMA = new Vector();
                vTTMA = m.LayTTMA(langid);
                KhuVuc_Model kv = new KhuVuc_Model();
                Vector vkv = new Vector();
                vkv = kv.LayDSKV(langid);
                int count = DauBep_Model.HoiThuc();
                if(count > 0){
                    Vector vDSHoiThuc = new Vector();
                    vDSHoiThuc = m.LayDSHoiThuc(langid);
                    request.setAttribute("DSHoiThuc", vDSHoiThuc);                    
                }
                request.setAttribute("DSMA", vDSMA);
                request.setAttribute("DSKV", vkv);
                request.setAttribute("DSTTMA", vTTMA);
                request.setAttribute("count", Integer.toString(count));
                RequestDispatcher rd = request.getRequestDispatcher("cook/rscook.jsp");
                rd.forward(request, response);
            }
            else if(action.equals("BoQuaHoiThuc")){
                String MaCTHDT = request.getParameter("MaCTHDT");
                DauBep_Model.BoQuaHoiThuc(Integer.parseInt(MaCTHDT));
//                DauBep_Model m = new DauBep_Model();
//                Vector vDSMA = new Vector();
//                vDSMA = m.LayDSMACook(langid);
//                Vector vTTMA = new Vector();
//                vTTMA = m.LayTTMA(langid);
//                KhuVuc_Model kv = new KhuVuc_Model();
//                Vector vkv = new Vector();
//                vkv = kv.LayDSKV(langid);
//                int count = DauBep_Model.HoiThuc();
//                if(count > 0){
//                    Vector vDSHoiThuc = new Vector();
//                    vDSHoiThuc = m.LayDSHoiThuc(langid);
//                    request.setAttribute("DSHoiThuc", vDSHoiThuc);
//                }
//                request.setAttribute("DSMA", vDSMA);
//                request.setAttribute("DSKV", vkv);
//                request.setAttribute("DSTTMA", vTTMA);
//                request.setAttribute("count", Integer.toString(count));
//                RequestDispatcher rd = request.getRequestDispatcher("cook/rscook.jsp");
//                rd.forward(request, response);
            }
            else if(action.equals("UpdateTTMACook3")){
                String MaCTHDT = request.getParameter("MaCTHDT");
                String MaTTMA = request.getParameter("MaTTMA");
                DauBep_Model.UpdateTTMACook(Integer.parseInt(MaCTHDT), Integer.parseInt(MaTTMA));
                DauBep_Model m = new DauBep_Model();
                Vector vDSMA = new Vector();
                vDSMA = m.LayDSMACook(langid);
                Vector vTTMA = new Vector();
                vTTMA = m.LayTTMA(langid);
                KhuVuc_Model kv = new KhuVuc_Model();
                Vector vkv = new Vector();
                vkv = kv.LayDSKV(langid);
                int count = DauBep_Model.HoiThuc();
                if(count > 0){
                    Vector vDSHoiThuc = new Vector();
                    vDSHoiThuc = m.LayDSHoiThuc(langid);
                    request.setAttribute("DSHoiThuc", vDSHoiThuc);
                }
                request.setAttribute("DSMA", vDSMA);
                request.setAttribute("DSKV", vkv);
                request.setAttribute("DSTTMA", vTTMA);
                request.setAttribute("count", Integer.toString(count));
                RequestDispatcher rd = request.getRequestDispatcher("cook/rscook3.jsp");
                rd.forward(request, response);
            }
            else if(action.equals("UpdateTTCook")){
                String TT = request.getParameter("TT");
                String MaMA = request.getParameter("MaMA");
                String MaCTHDT = request.getParameter("MaCTHDT");
                DauBep_Model.UpdateTTCook(Integer.parseInt(TT), Integer.parseInt(MaMA), Integer.parseInt(MaCTHDT));
                DauBep_Model m = new DauBep_Model();
                Vector vDSMA = new Vector();
                vDSMA = m.LayDSMACook(langid);
                Vector vTTMA = new Vector();
                vTTMA = m.LayTTMA(langid);
                KhuVuc_Model kv = new KhuVuc_Model();
                Vector vkv = new Vector();
                vkv = kv.LayDSKV(langid);
                int count = DauBep_Model.HoiThuc();
                if(count > 0){
                    Vector vDSHoiThuc = new Vector();
                    vDSHoiThuc = m.LayDSHoiThuc(langid);
                    request.setAttribute("DSHoiThuc", vDSHoiThuc);
                }
                request.setAttribute("DSMA", vDSMA);
                request.setAttribute("DSKV", vkv);
                request.setAttribute("DSTTMA", vTTMA);
                request.setAttribute("count", Integer.toString(count));
                RequestDispatcher rd = request.getRequestDispatcher("cook/rscook.jsp");
                rd.forward(request, response);
            }
            else if (action.equals("SortNgayGioCook")) {
                String item = request.getParameter("item");
                String order = request.getParameter("order");
                String sort = request.getParameter("sort");
                String sortkv = request.getParameter("sortkv");
                DauBep_Model m = new DauBep_Model();
                Vector vDSMA = new Vector();
                vDSMA = m.SortNgayGioCook(langid, order);
                Vector vTTMA = new Vector();
                vTTMA = m.LayTTMA(langid);
                KhuVuc_Model kv = new KhuVuc_Model();
                Vector vkv = new Vector();
                vkv = kv.LayDSKV(langid);
                int count = DauBep_Model.HoiThuc();
                if(count > 0){
                    Vector vDSHoiThuc = new Vector();
                    vDSHoiThuc = m.LayDSHoiThuc(langid);
                    request.setAttribute("DSHoiThuc", vDSHoiThuc);
                }
                request.setAttribute("DSMA", vDSMA);
                request.setAttribute("DSKV", vkv);
                request.setAttribute("DSTTMA", vTTMA);
                request.setAttribute("item", item);
                request.setAttribute("order", order);
                request.setAttribute("test", "1");
                request.setAttribute("sort", sort);
                request.setAttribute("sortkv", sortkv);
                request.setAttribute("count", Integer.toString(count));
                RequestDispatcher rd = request.getRequestDispatcher("cook/rssortcook.jsp");
                rd.forward(request, response);
            }
            else if (action.equals("SortNgayGioCook3")) {
                String item = request.getParameter("item");
                String order = request.getParameter("order");
                String sort = request.getParameter("sort");
                String sortkv = request.getParameter("sortkv");
                DauBep_Model m = new DauBep_Model();
                Vector vDSMA = new Vector();
                vDSMA = m.SortNgayGioCook3(langid, order);
                Vector vTTMA = new Vector();
                vTTMA = m.LayTTMA(langid);
                KhuVuc_Model kv = new KhuVuc_Model();
                Vector vkv = new Vector();
                vkv = kv.LayDSKV(langid);
                int count = DauBep_Model.HoiThuc();
                if(count > 0){
                    Vector vDSHoiThuc = new Vector();
                    vDSHoiThuc = m.LayDSHoiThuc(langid);
                    request.setAttribute("DSHoiThuc", vDSHoiThuc);
                }
                request.setAttribute("DSMA", vDSMA);
                request.setAttribute("DSKV", vkv);
                request.setAttribute("DSTTMA", vTTMA);
                request.setAttribute("item", item);
                request.setAttribute("order", order);
                request.setAttribute("test", "1");
                request.setAttribute("sort", sort);
                request.setAttribute("sortkv", sortkv);
                request.setAttribute("count", Integer.toString(count));
                RequestDispatcher rd = request.getRequestDispatcher("cook/rssortcook3.jsp");
                rd.forward(request, response);
            }
            else if (action.equals("SortKVCook")) {
                String item = request.getParameter("item");
                String order = request.getParameter("order");
                String sort = request.getParameter("sort");
                String sortkv = request.getParameter("sortkv");
                DauBep_Model m = new DauBep_Model();
                Vector vDSMA = new Vector();
                vDSMA = m.SortKVCook(langid, order);
                Vector vTTMA = new Vector();
                vTTMA = m.LayTTMA(langid);
                KhuVuc_Model kv = new KhuVuc_Model();
                Vector vkv = new Vector();
                vkv = kv.LayDSKV(langid);
                int count = DauBep_Model.HoiThuc();
                if(count > 0){
                    Vector vDSHoiThuc = new Vector();
                    vDSHoiThuc = m.LayDSHoiThuc(langid);
                    request.setAttribute("DSHoiThuc", vDSHoiThuc);
                }
                request.setAttribute("DSMA", vDSMA);
                request.setAttribute("DSKV", vkv);
                request.setAttribute("DSTTMA", vTTMA);
                request.setAttribute("item", item);
                request.setAttribute("order", order);
                request.setAttribute("test", "2");
                request.setAttribute("sort", sort);
                request.setAttribute("sortkv", sortkv);
                request.setAttribute("count", Integer.toString(count));
                RequestDispatcher rd = request.getRequestDispatcher("cook/rssortcook.jsp");
                rd.forward(request, response);
            }
            else if (action.equals("SortKVCook3")) {
                String item = request.getParameter("item");
                String order = request.getParameter("order");
                String sort = request.getParameter("sort");
                String sortkv = request.getParameter("sortkv");
                DauBep_Model m = new DauBep_Model();
                Vector vDSMA = new Vector();
                vDSMA = m.SortKVCook3(langid, order);
                Vector vTTMA = new Vector();
                vTTMA = m.LayTTMA(langid);
                KhuVuc_Model kv = new KhuVuc_Model();
                Vector vkv = new Vector();
                vkv = kv.LayDSKV(langid);
                int count = DauBep_Model.HoiThuc();
                if(count > 0){
                    Vector vDSHoiThuc = new Vector();
                    vDSHoiThuc = m.LayDSHoiThuc(langid);
                    request.setAttribute("DSHoiThuc", vDSHoiThuc);
                }
                request.setAttribute("DSMA", vDSMA);
                request.setAttribute("DSKV", vkv);
                request.setAttribute("DSTTMA", vTTMA);
                request.setAttribute("item", item);
                request.setAttribute("order", order);
                request.setAttribute("test", "2");
                request.setAttribute("sort", sort);
                request.setAttribute("sortkv", sortkv);
                request.setAttribute("count", Integer.toString(count));
                RequestDispatcher rd = request.getRequestDispatcher("cook/rssortcook3.jsp");
                rd.forward(request, response);
            }
            else if (action.equals("SortBanCook")) {
                String item = request.getParameter("item");
                String order = request.getParameter("order");
                String sort = request.getParameter("sort");
                String sortkv = request.getParameter("sortkv");
                DauBep_Model m = new DauBep_Model();
                Vector vDSMA = new Vector();
                vDSMA = m.SortBanCook(langid, order);
                Vector vTTMA = new Vector();
                vTTMA = m.LayTTMA(langid);
                KhuVuc_Model kv = new KhuVuc_Model();
                Vector vkv = new Vector();
                vkv = kv.LayDSKV(langid);
                int count = DauBep_Model.HoiThuc();
                if(count > 0){
                    Vector vDSHoiThuc = new Vector();
                    vDSHoiThuc = m.LayDSHoiThuc(langid);
                    request.setAttribute("DSHoiThuc", vDSHoiThuc);
                }
                request.setAttribute("DSMA", vDSMA);
                request.setAttribute("DSKV", vkv);
                request.setAttribute("DSTTMA", vTTMA);
                request.setAttribute("item", item);
                request.setAttribute("order", order);
                request.setAttribute("test", "3");
                request.setAttribute("sort", sort);
                request.setAttribute("sortkv", sortkv);
                request.setAttribute("count", Integer.toString(count));
                RequestDispatcher rd = request.getRequestDispatcher("cook/rssortcook.jsp");
                rd.forward(request, response);
            }
            else if (action.equals("SortBanCook3")) {
                String item = request.getParameter("item");
                String order = request.getParameter("order");
                String sort = request.getParameter("sort");
                String sortkv = request.getParameter("sortkv");
                DauBep_Model m = new DauBep_Model();
                Vector vDSMA = new Vector();
                vDSMA = m.SortBanCook3(langid, order);
                Vector vTTMA = new Vector();
                vTTMA = m.LayTTMA(langid);
                KhuVuc_Model kv = new KhuVuc_Model();
                Vector vkv = new Vector();
                vkv = kv.LayDSKV(langid);
                int count = DauBep_Model.HoiThuc();
                if(count > 0){
                    Vector vDSHoiThuc = new Vector();
                    vDSHoiThuc = m.LayDSHoiThuc(langid);
                    request.setAttribute("DSHoiThuc", vDSHoiThuc);
                }
                request.setAttribute("DSMA", vDSMA);
                request.setAttribute("DSKV", vkv);
                request.setAttribute("DSTTMA", vTTMA);
                request.setAttribute("item", item);
                request.setAttribute("order", order);
                request.setAttribute("test", "3");
                request.setAttribute("sort", sort);
                request.setAttribute("sortkv", sortkv);
                request.setAttribute("count", Integer.toString(count));
                RequestDispatcher rd = request.getRequestDispatcher("cook/rssortcook3.jsp");
                rd.forward(request, response);
            }
            else if (action.equals("SortMACook")) {
                String item = request.getParameter("item");
                String order = request.getParameter("order");
                String sort = request.getParameter("sort");
                String sortkv = request.getParameter("sortkv");
                DauBep_Model m = new DauBep_Model();
                Vector vDSMA = new Vector();
                vDSMA = m.SortMACook(langid, order);
                Vector vTTMA = new Vector();
                vTTMA = m.LayTTMA(langid);
                KhuVuc_Model kv = new KhuVuc_Model();
                Vector vkv = new Vector();
                vkv = kv.LayDSKV(langid);
                int count = DauBep_Model.HoiThuc();
                if(count > 0){
                    Vector vDSHoiThuc = new Vector();
                    vDSHoiThuc = m.LayDSHoiThuc(langid);
                    request.setAttribute("DSHoiThuc", vDSHoiThuc);
                }
                request.setAttribute("DSMA", vDSMA);
                request.setAttribute("DSKV", vkv);
                request.setAttribute("DSTTMA", vTTMA);
                request.setAttribute("item", item);
                request.setAttribute("order", order);
                request.setAttribute("test", "4");
                request.setAttribute("sort", sort);
                request.setAttribute("sortkv", sortkv);
                request.setAttribute("count", Integer.toString(count));
                RequestDispatcher rd = request.getRequestDispatcher("cook/rssortcook.jsp");
                rd.forward(request, response);
            }
            else if (action.equals("SortMACook3")) {
                String item = request.getParameter("item");
                String order = request.getParameter("order");
                String sort = request.getParameter("sort");
                String sortkv = request.getParameter("sortkv");
                DauBep_Model m = new DauBep_Model();
                Vector vDSMA = new Vector();
                vDSMA = m.SortMACook3(langid, order);
                Vector vTTMA = new Vector();
                vTTMA = m.LayTTMA(langid);
                KhuVuc_Model kv = new KhuVuc_Model();
                Vector vkv = new Vector();
                vkv = kv.LayDSKV(langid);
                int count = DauBep_Model.HoiThuc();
                if(count > 0){
                    Vector vDSHoiThuc = new Vector();
                    vDSHoiThuc = m.LayDSHoiThuc(langid);
                    request.setAttribute("DSHoiThuc", vDSHoiThuc);
                }
                request.setAttribute("DSMA", vDSMA);
                request.setAttribute("DSKV", vkv);
                request.setAttribute("DSTTMA", vTTMA);
                request.setAttribute("item", item);
                request.setAttribute("order", order);
                request.setAttribute("test", "4");
                request.setAttribute("sort", sort);
                request.setAttribute("sortkv", sortkv);
                request.setAttribute("count", Integer.toString(count));
                RequestDispatcher rd = request.getRequestDispatcher("cook/rssortcook3.jsp");
                rd.forward(request, response);
            }
            else if (action.equals("SortDVTCook")) {
                String item = request.getParameter("item");
                String order = request.getParameter("order");
                String sort = request.getParameter("sort");
                String sortkv = request.getParameter("sortkv");
                DauBep_Model m = new DauBep_Model();
                Vector vDSMA = new Vector();
                vDSMA = m.SortDVTCook(langid, order);
                Vector vTTMA = new Vector();
                vTTMA = m.LayTTMA(langid);
                KhuVuc_Model kv = new KhuVuc_Model();
                Vector vkv = new Vector();
                vkv = kv.LayDSKV(langid);
                int count = DauBep_Model.HoiThuc();
                if(count > 0){
                    Vector vDSHoiThuc = new Vector();
                    vDSHoiThuc = m.LayDSHoiThuc(langid);
                    request.setAttribute("DSHoiThuc", vDSHoiThuc);
                }
                request.setAttribute("DSMA", vDSMA);
                request.setAttribute("DSKV", vkv);
                request.setAttribute("DSTTMA", vTTMA);
                request.setAttribute("item", item);
                request.setAttribute("order", order);
                request.setAttribute("test", "5");
                request.setAttribute("sort", sort);
                request.setAttribute("sortkv", sortkv);
                request.setAttribute("count", Integer.toString(count));
                RequestDispatcher rd = request.getRequestDispatcher("cook/rssortcook.jsp");
                rd.forward(request, response);
            }
            else if (action.equals("SortDVTCook3")) {
                String item = request.getParameter("item");
                String order = request.getParameter("order");
                String sort = request.getParameter("sort");
                String sortkv = request.getParameter("sortkv");
                DauBep_Model m = new DauBep_Model();
                Vector vDSMA = new Vector();
                vDSMA = m.SortDVTCook3(langid, order);
                Vector vTTMA = new Vector();
                vTTMA = m.LayTTMA(langid);
                KhuVuc_Model kv = new KhuVuc_Model();
                Vector vkv = new Vector();
                vkv = kv.LayDSKV(langid);
                int count = DauBep_Model.HoiThuc();
                if(count > 0){
                    Vector vDSHoiThuc = new Vector();
                    vDSHoiThuc = m.LayDSHoiThuc(langid);
                    request.setAttribute("DSHoiThuc", vDSHoiThuc);
                }
                request.setAttribute("DSMA", vDSMA);
                request.setAttribute("DSKV", vkv);
                request.setAttribute("DSTTMA", vTTMA);
                request.setAttribute("item", item);
                request.setAttribute("order", order);
                request.setAttribute("test", "5");
                request.setAttribute("sort", sort);
                request.setAttribute("sortkv", sortkv);
                request.setAttribute("count", Integer.toString(count));
                RequestDispatcher rd = request.getRequestDispatcher("cook/rssortcook3.jsp");
                rd.forward(request, response);
            }
            else if (action.equals("SortSLCook")) {
                String item = request.getParameter("item");
                String order = request.getParameter("order");
                String sort = request.getParameter("sort");
                String sortkv = request.getParameter("sortkv");
                DauBep_Model m = new DauBep_Model();
                Vector vDSMA = new Vector();
                vDSMA = m.SortSLCook(langid, order);
                Vector vTTMA = new Vector();
                vTTMA = m.LayTTMA(langid);
                KhuVuc_Model kv = new KhuVuc_Model();
                Vector vkv = new Vector();
                vkv = kv.LayDSKV(langid);
                int count = DauBep_Model.HoiThuc();
                if(count > 0){
                    Vector vDSHoiThuc = new Vector();
                    vDSHoiThuc = m.LayDSHoiThuc(langid);
                    request.setAttribute("DSHoiThuc", vDSHoiThuc);
                }
                request.setAttribute("DSMA", vDSMA);
                request.setAttribute("DSKV", vkv);
                request.setAttribute("DSTTMA", vTTMA);
                request.setAttribute("item", item);
                request.setAttribute("order", order);
                request.setAttribute("test", "6");
                request.setAttribute("sort", sort);
                request.setAttribute("sortkv", sortkv);
                request.setAttribute("count", Integer.toString(count));
                RequestDispatcher rd = request.getRequestDispatcher("cook/rssortcook.jsp");
                rd.forward(request, response);
            }
            else if (action.equals("SortSLCook3")) {
                String item = request.getParameter("item");
                String order = request.getParameter("order");
                String sort = request.getParameter("sort");
                String sortkv = request.getParameter("sortkv");
                DauBep_Model m = new DauBep_Model();
                Vector vDSMA = new Vector();
                vDSMA = m.SortSLCook3(langid, order);
                Vector vTTMA = new Vector();
                vTTMA = m.LayTTMA(langid);
                KhuVuc_Model kv = new KhuVuc_Model();
                Vector vkv = new Vector();
                vkv = kv.LayDSKV(langid);
                int count = DauBep_Model.HoiThuc();
                if(count > 0){
                    Vector vDSHoiThuc = new Vector();
                    vDSHoiThuc = m.LayDSHoiThuc(langid);
                    request.setAttribute("DSHoiThuc", vDSHoiThuc);
                }
                request.setAttribute("DSMA", vDSMA);
                request.setAttribute("DSKV", vkv);
                request.setAttribute("DSTTMA", vTTMA);
                request.setAttribute("item", item);
                request.setAttribute("order", order);
                request.setAttribute("test", "6");
                request.setAttribute("sort", sort);
                request.setAttribute("sortkv", sortkv);
                request.setAttribute("count", Integer.toString(count));
                RequestDispatcher rd = request.getRequestDispatcher("cook/rssortcook3.jsp");
                rd.forward(request, response);
            }
            else if (action.equals("SortTTCook")) {
                String item = request.getParameter("item");
                String order = request.getParameter("order");
                String sort = request.getParameter("sort");
                String sortkv = request.getParameter("sortkv");
                DauBep_Model m = new DauBep_Model();
                Vector vDSMA = new Vector();
                vDSMA = m.SortTTCook(langid, order);
                Vector vTTMA = new Vector();
                vTTMA = m.LayTTMA(langid);
                KhuVuc_Model kv = new KhuVuc_Model();
                Vector vkv = new Vector();
                vkv = kv.LayDSKV(langid);
                int count = DauBep_Model.HoiThuc();
                if(count > 0){
                    Vector vDSHoiThuc = new Vector();
                    vDSHoiThuc = m.LayDSHoiThuc(langid);
                    request.setAttribute("DSHoiThuc", vDSHoiThuc);
                }
                request.setAttribute("DSMA", vDSMA);
                request.setAttribute("DSKV", vkv);
                request.setAttribute("DSTTMA", vTTMA);
                request.setAttribute("item", item);
                request.setAttribute("order", order);
                request.setAttribute("test", "8");
                request.setAttribute("sort", sort);
                request.setAttribute("sortkv", sortkv);
                request.setAttribute("count", Integer.toString(count));
                RequestDispatcher rd = request.getRequestDispatcher("cook/rssortcook.jsp");
                rd.forward(request, response);
            }
            else if (action.equals("SortTTCook3")) {
                String item = request.getParameter("item");
                String order = request.getParameter("order");
                String sort = request.getParameter("sort");
                String sortkv = request.getParameter("sortkv");
                DauBep_Model m = new DauBep_Model();
                Vector vDSMA = new Vector();
                vDSMA = m.SortTTCook3(langid, order);
                Vector vTTMA = new Vector();
                vTTMA = m.LayTTMA(langid);
                KhuVuc_Model kv = new KhuVuc_Model();
                Vector vkv = new Vector();
                vkv = kv.LayDSKV(langid);
                int count = DauBep_Model.HoiThuc();
                if(count > 0){
                    Vector vDSHoiThuc = new Vector();
                    vDSHoiThuc = m.LayDSHoiThuc(langid);
                    request.setAttribute("DSHoiThuc", vDSHoiThuc);
                }
                request.setAttribute("DSMA", vDSMA);
                request.setAttribute("DSKV", vkv);
                request.setAttribute("DSTTMA", vTTMA);
                request.setAttribute("item", item);
                request.setAttribute("order", order);
                request.setAttribute("test", "8");
                request.setAttribute("sort", sort);
                request.setAttribute("sortkv", sortkv);
                request.setAttribute("count", Integer.toString(count));
                RequestDispatcher rd = request.getRequestDispatcher("cook/rssortcook3.jsp");
                rd.forward(request, response);
            }
            else if (action.equals("SearchCook")) {
                String makv = request.getParameter("makv");
                String tenban = request.getParameter("tenban");
                String tenma = request.getParameter("tenma");
                String tendvt = request.getParameter("tendvt");
                String soluong = request.getParameter("soluong");
                String mattma = request.getParameter("mattma");
                DauBep_Model m = new DauBep_Model();
                Vector vDSMA = new Vector();                
                vDSMA = m.SearchCook(makv, tenban, tenma, tendvt, soluong, mattma, langid);
                Vector vTTMA = new Vector();
                vTTMA = m.LayTTMA(langid);
                KhuVuc_Model kv = new KhuVuc_Model();
                Vector vkv = new Vector();
                vkv = kv.LayDSKV(langid);
                int count = DauBep_Model.HoiThuc();
                if(count > 0){
                    Vector vDSHoiThuc = new Vector();
                    vDSHoiThuc = m.LayDSHoiThuc(langid);
                    request.setAttribute("DSHoiThuc", vDSHoiThuc);
                }
                request.setAttribute("DSMA", vDSMA);
                request.setAttribute("DSKV", vkv);                
                request.setAttribute("DSTTMA", vTTMA);
                request.setAttribute("tenma", tenma);
                request.setAttribute("makv", makv);
                request.setAttribute("tenban", tenban);
                request.setAttribute("tendvt", tendvt);
                request.setAttribute("soluong", soluong);
                request.setAttribute("mattma", mattma);
                request.setAttribute("count", Integer.toString(count));
                RequestDispatcher rd = request.getRequestDispatcher("cook/rssearchcook.jsp");
                rd.forward(request, response);
            }
            else if (action.equals("SortSearchNgayGioCook")) {
                String item = request.getParameter("item");
                String order = request.getParameter("order");
                String sort = request.getParameter("sort");
                String sortkv = request.getParameter("sortkv");
                String makv = request.getParameter("makv");
                String tenban = request.getParameter("tenban");
                String tenma = request.getParameter("tenma");
                String tendvt = request.getParameter("tendvt");
                String soluong = request.getParameter("soluong");
                String mattma = request.getParameter("mattma");
                DauBep_Model m = new DauBep_Model();
                Vector vDSMA = new Vector();
                vDSMA = m.SortSearchNgayGioCook(makv, tenban, tenma, tendvt, soluong, mattma, langid, order);
                Vector vTTMA = new Vector();
                vTTMA = m.LayTTMA(langid);
                KhuVuc_Model kv = new KhuVuc_Model();
                Vector vkv = new Vector();
                vkv = kv.LayDSKV(langid);
                int count = DauBep_Model.HoiThuc();
                if(count > 0){
                    Vector vDSHoiThuc = new Vector();
                    vDSHoiThuc = m.LayDSHoiThuc(langid);
                    request.setAttribute("DSHoiThuc", vDSHoiThuc);
                }
                request.setAttribute("DSMA", vDSMA);
                request.setAttribute("DSKV", vkv);
                request.setAttribute("DSTTMA", vTTMA);                
                request.setAttribute("item", item);
                request.setAttribute("order", order);
                request.setAttribute("test", "1");
                request.setAttribute("sort", sort);
                request.setAttribute("sortkv", sortkv);
                request.setAttribute("tenma", tenma);
                request.setAttribute("makv", makv);
                request.setAttribute("tenban", tenban);
                request.setAttribute("tendvt", tendvt);
                request.setAttribute("soluong", soluong);
                request.setAttribute("mattma", mattma);
                request.setAttribute("count", Integer.toString(count));
                RequestDispatcher rd = request.getRequestDispatcher("cook/rssortsearchcook.jsp");
                rd.forward(request, response);
            }
            else if (action.equals("SortSearchKVCook")) {
                String item = request.getParameter("item");
                String order = request.getParameter("order");
                String sort = request.getParameter("sort");
                String sortkv = request.getParameter("sortkv");
                String makv = request.getParameter("makv");
                String tenban = request.getParameter("tenban");
                String tenma = request.getParameter("tenma");
                String tendvt = request.getParameter("tendvt");
                String soluong = request.getParameter("soluong");
                String mattma = request.getParameter("mattma");
                DauBep_Model m = new DauBep_Model();
                Vector vDSMA = new Vector();
                vDSMA = m.SortSearchKVCook(makv, tenban, tenma, tendvt, soluong, mattma, langid, order);
                Vector vTTMA = new Vector();
                vTTMA = m.LayTTMA(langid);
                KhuVuc_Model kv = new KhuVuc_Model();
                Vector vkv = new Vector();
                vkv = kv.LayDSKV(langid);
                int count = DauBep_Model.HoiThuc();
                if(count > 0){
                    Vector vDSHoiThuc = new Vector();
                    vDSHoiThuc = m.LayDSHoiThuc(langid);
                    request.setAttribute("DSHoiThuc", vDSHoiThuc);
                }
                request.setAttribute("DSMA", vDSMA);
                request.setAttribute("DSKV", vkv);
                request.setAttribute("DSTTMA", vTTMA);                
                request.setAttribute("item", item);
                request.setAttribute("order", order);
                request.setAttribute("test", "2");
                request.setAttribute("sort", sort);
                request.setAttribute("sortkv", sortkv);
                request.setAttribute("tenma", tenma);
                request.setAttribute("makv", makv);
                request.setAttribute("tenban", tenban);
                request.setAttribute("tendvt", tendvt);
                request.setAttribute("soluong", soluong);
                request.setAttribute("mattma", mattma);
                request.setAttribute("count", Integer.toString(count));
                RequestDispatcher rd = request.getRequestDispatcher("cook/rssortsearchcook.jsp");
                rd.forward(request, response);
            }
            else if (action.equals("SortSearchBanCook")) {
                String item = request.getParameter("item");
                String order = request.getParameter("order");
                String sort = request.getParameter("sort");
                String sortkv = request.getParameter("sortkv");
                String makv = request.getParameter("makv");
                String tenban = request.getParameter("tenban");
                String tenma = request.getParameter("tenma");
                String tendvt = request.getParameter("tendvt");
                String soluong = request.getParameter("soluong");
                String mattma = request.getParameter("mattma");
                DauBep_Model m = new DauBep_Model();
                Vector vDSMA = new Vector();
                vDSMA = m.SortSearchBanCook(makv, tenban, tenma, tendvt, soluong, mattma, langid, order);
                Vector vTTMA = new Vector();
                vTTMA = m.LayTTMA(langid);
                KhuVuc_Model kv = new KhuVuc_Model();
                Vector vkv = new Vector();
                vkv = kv.LayDSKV(langid);
                int count = DauBep_Model.HoiThuc();
                if(count > 0){
                    Vector vDSHoiThuc = new Vector();
                    vDSHoiThuc = m.LayDSHoiThuc(langid);
                    request.setAttribute("DSHoiThuc", vDSHoiThuc);
                }
                request.setAttribute("DSMA", vDSMA);
                request.setAttribute("DSKV", vkv);
                request.setAttribute("DSTTMA", vTTMA);                
                request.setAttribute("item", item);
                request.setAttribute("order", order);
                request.setAttribute("test", "3");
                request.setAttribute("sort", sort);
                request.setAttribute("sortkv", sortkv);
                request.setAttribute("tenma", tenma);
                request.setAttribute("makv", makv);
                request.setAttribute("tenban", tenban);
                request.setAttribute("tendvt", tendvt);
                request.setAttribute("soluong", soluong);
                request.setAttribute("mattma", mattma);
                request.setAttribute("count", Integer.toString(count));
                RequestDispatcher rd = request.getRequestDispatcher("cook/rssortsearchcook.jsp");
                rd.forward(request, response);
            }
            else if (action.equals("SortSearchMACook")) {
                String item = request.getParameter("item");
                String order = request.getParameter("order");
                String sort = request.getParameter("sort");
                String sortkv = request.getParameter("sortkv");
                String makv = request.getParameter("makv");
                String tenban = request.getParameter("tenban");
                String tenma = request.getParameter("tenma");
                String tendvt = request.getParameter("tendvt");
                String soluong = request.getParameter("soluong");
                String mattma = request.getParameter("mattma");
                DauBep_Model m = new DauBep_Model();
                Vector vDSMA = new Vector();
                vDSMA = m.SortSearchMACook(makv, tenban, tenma, tendvt, soluong, mattma, langid, order);
                Vector vTTMA = new Vector();
                vTTMA = m.LayTTMA(langid);
                KhuVuc_Model kv = new KhuVuc_Model();
                Vector vkv = new Vector();
                vkv = kv.LayDSKV(langid);
                int count = DauBep_Model.HoiThuc();
                if(count > 0){
                    Vector vDSHoiThuc = new Vector();
                    vDSHoiThuc = m.LayDSHoiThuc(langid);
                    request.setAttribute("DSHoiThuc", vDSHoiThuc);
                }
                request.setAttribute("DSMA", vDSMA);
                request.setAttribute("DSKV", vkv);
                request.setAttribute("DSTTMA", vTTMA);                
                request.setAttribute("item", item);
                request.setAttribute("order", order);
                request.setAttribute("test", "4");
                request.setAttribute("sort", sort);
                request.setAttribute("sortkv", sortkv);
                request.setAttribute("tenma", tenma);
                request.setAttribute("makv", makv);
                request.setAttribute("tenban", tenban);
                request.setAttribute("tendvt", tendvt);
                request.setAttribute("soluong", soluong);
                request.setAttribute("mattma", mattma);
                request.setAttribute("count", Integer.toString(count));
                RequestDispatcher rd = request.getRequestDispatcher("cook/rssortsearchcook.jsp");
                rd.forward(request, response);
            }
            else if (action.equals("SortSearchDVTCook")) {
                String item = request.getParameter("item");
                String order = request.getParameter("order");
                String sort = request.getParameter("sort");
                String sortkv = request.getParameter("sortkv");
                String makv = request.getParameter("makv");
                String tenban = request.getParameter("tenban");
                String tenma = request.getParameter("tenma");
                String tendvt = request.getParameter("tendvt");
                String soluong = request.getParameter("soluong");
                String mattma = request.getParameter("mattma");
                DauBep_Model m = new DauBep_Model();
                Vector vDSMA = new Vector();
                vDSMA = m.SortSearchDVTCook(makv, tenban, tenma, tendvt, soluong, mattma, langid, order);
                Vector vTTMA = new Vector();
                vTTMA = m.LayTTMA(langid);
                KhuVuc_Model kv = new KhuVuc_Model();
                Vector vkv = new Vector();
                vkv = kv.LayDSKV(langid);
                int count = DauBep_Model.HoiThuc();
                if(count > 0){
                    Vector vDSHoiThuc = new Vector();
                    vDSHoiThuc = m.LayDSHoiThuc(langid);
                    request.setAttribute("DSHoiThuc", vDSHoiThuc);
                }
                request.setAttribute("DSMA", vDSMA);
                request.setAttribute("DSKV", vkv);
                request.setAttribute("DSTTMA", vTTMA);                
                request.setAttribute("item", item);
                request.setAttribute("order", order);
                request.setAttribute("test", "5");
                request.setAttribute("sort", sort);
                request.setAttribute("sortkv", sortkv);
                request.setAttribute("tenma", tenma);
                request.setAttribute("makv", makv);
                request.setAttribute("tenban", tenban);
                request.setAttribute("tendvt", tendvt);
                request.setAttribute("soluong", soluong);
                request.setAttribute("mattma", mattma);
                request.setAttribute("count", Integer.toString(count));
                RequestDispatcher rd = request.getRequestDispatcher("cook/rssortsearchcook.jsp");
                rd.forward(request, response);
            }
            else if (action.equals("SortSearchSLCook")) {
                String item = request.getParameter("item");
                String order = request.getParameter("order");
                String sort = request.getParameter("sort");
                String sortkv = request.getParameter("sortkv");
                String makv = request.getParameter("makv");
                String tenban = request.getParameter("tenban");
                String tenma = request.getParameter("tenma");
                String tendvt = request.getParameter("tendvt");
                String soluong = request.getParameter("soluong");
                String mattma = request.getParameter("mattma");
                DauBep_Model m = new DauBep_Model();
                Vector vDSMA = new Vector();
                vDSMA = m.SortSearchSLCook(makv, tenban, tenma, tendvt, soluong, mattma, langid, order);
                Vector vTTMA = new Vector();
                vTTMA = m.LayTTMA(langid);
                KhuVuc_Model kv = new KhuVuc_Model();
                Vector vkv = new Vector();
                vkv = kv.LayDSKV(langid);
                int count = DauBep_Model.HoiThuc();
                if(count > 0){
                    Vector vDSHoiThuc = new Vector();
                    vDSHoiThuc = m.LayDSHoiThuc(langid);
                    request.setAttribute("DSHoiThuc", vDSHoiThuc);
                }
                request.setAttribute("DSMA", vDSMA);
                request.setAttribute("DSKV", vkv);
                request.setAttribute("DSTTMA", vTTMA);                
                request.setAttribute("item", item);
                request.setAttribute("order", order);
                request.setAttribute("test", "6");
                request.setAttribute("sort", sort);
                request.setAttribute("sortkv", sortkv);
                request.setAttribute("tenma", tenma);
                request.setAttribute("makv", makv);
                request.setAttribute("tenban", tenban);
                request.setAttribute("tendvt", tendvt);
                request.setAttribute("soluong", soluong);
                request.setAttribute("mattma", mattma);
                request.setAttribute("count", Integer.toString(count));
                RequestDispatcher rd = request.getRequestDispatcher("cook/rssortsearchcook.jsp");
                rd.forward(request, response);
            }
            else if (action.equals("SortSearchTTCook")) {
                String item = request.getParameter("item");
                String order = request.getParameter("order");
                String sort = request.getParameter("sort");
                String sortkv = request.getParameter("sortkv");
                String makv = request.getParameter("makv");
                String tenban = request.getParameter("tenban");
                String tenma = request.getParameter("tenma");
                String tendvt = request.getParameter("tendvt");
                String soluong = request.getParameter("soluong");
                String mattma = request.getParameter("mattma");
                DauBep_Model m = new DauBep_Model();
                Vector vDSMA = new Vector();
                vDSMA = m.SortSearchTTCook(makv, tenban, tenma, tendvt, soluong, mattma, langid, order);
                Vector vTTMA = new Vector();
                vTTMA = m.LayTTMA(langid);
                KhuVuc_Model kv = new KhuVuc_Model();
                Vector vkv = new Vector();
                vkv = kv.LayDSKV(langid);
                int count = DauBep_Model.HoiThuc();
                if(count > 0){
                    Vector vDSHoiThuc = new Vector();
                    vDSHoiThuc = m.LayDSHoiThuc(langid);
                    request.setAttribute("DSHoiThuc", vDSHoiThuc);
                }
                request.setAttribute("DSMA", vDSMA);
                request.setAttribute("DSKV", vkv);
                request.setAttribute("DSTTMA", vTTMA);                
                request.setAttribute("item", item);
                request.setAttribute("order", order);
                request.setAttribute("test", "8");
                request.setAttribute("sort", sort);
                request.setAttribute("sortkv", sortkv);
                request.setAttribute("tenma", tenma);
                request.setAttribute("makv", makv);
                request.setAttribute("tenban", tenban);
                request.setAttribute("tendvt", tendvt);
                request.setAttribute("soluong", soluong);
                request.setAttribute("mattma", mattma);
                request.setAttribute("count", Integer.toString(count));
                RequestDispatcher rd = request.getRequestDispatcher("cook/rssortsearchcook.jsp");
                rd.forward(request, response);
            }
            else if(action.equals("InPhieuCook")){
                String MaMA = request.getParameter("MaMA");
                String SL = request.getParameter("SL");
                String DVT = request.getParameter("DVT");
                String GC = request.getParameter("GC");
                String MaCTHDT = request.getParameter("MaCTHDT");
                Vector v = new Vector();
                v = DauBep_Model.DSDauBep();
                request.setAttribute("DSDauBep", v);
                request.setAttribute("MaMA", MaMA);
                request.setAttribute("SL", SL);
                request.setAttribute("DVT", DVT);
                request.setAttribute("GC", GC);
                request.setAttribute("MaCTHDT", MaCTHDT);
                RequestDispatcher rd = request.getRequestDispatcher("cook/mbcook.jsp");
                rd.forward(request, response);
            }
            else if(action.equals("PhanCongMA")){
                String MaMA = request.getParameter("MaMA");
                String SL = request.getParameter("SL");
                String DVT = request.getParameter("DVT");
                String GC = request.getParameter("GC");
                String MaCTHDT = request.getParameter("MaCTHDT");
                String manv = request.getParameter("manv");
                String tendn = DoanhNghiep_Model.TenDN();
                String diachi = DoanhNghiep_Model.DiaChi();
                String sodt = DoanhNghiep_Model.SoDT();
                Calendar cal = Calendar.getInstance();
                SimpleDateFormat fm = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
                String ngaygio = fm.format(cal.getTime());                
                String cthdt[] = MaCTHDT.split(";");
                for(int i=0; i<cthdt.length; i++ ){
                    DauBep_Model.UpdateTTMACook(Integer.parseInt(cthdt[i]) , 2);
                    DauBep_Model.UpdateCTPDMA(Integer.parseInt(manv), Integer.parseInt(cthdt[i]));
                }                
                request.setAttribute("MaMA", MaMA);
                request.setAttribute("SL", SL);
                request.setAttribute("DVT", DVT);
                request.setAttribute("GC", GC);
                request.setAttribute("tendn", tendn);
                request.setAttribute("diachi", diachi);
                request.setAttribute("sodt", sodt);
                request.setAttribute("ngaygio", ngaygio);
                request.setAttribute("manv", manv);
                RequestDispatcher rd = request.getRequestDispatcher("cook/printcook.jsp");
                rd.forward(request, response);
            }
            
        } finally { 
            out.close();
        }
    } 

    // <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
    /** 
     * Handles the HTTP <code>GET</code> method.
     * @param request servlet request
     * @param response servlet response
     * @throws ServletException if a servlet-specific error occurs
     * @throws IOException if an I/O error occurs
     */
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
        processRequest(request, response);
    } 

    /** 
     * Handles the HTTP <code>POST</code> method.
     * @param request servlet request
     * @param response servlet response
     * @throws ServletException if a servlet-specific error occurs
     * @throws IOException if an I/O error occurs
     */
    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
        processRequest(request, response);
    }

    /** 
     * Returns a short description of the servlet.
     * @return a String containing servlet description
     */
    @Override
    public String getServletInfo() {
        return "Short description";
    }// </editor-fold>

}
